<?php
namespace app\scodetrace\controller;
use \Hashids\Hashids;

use \app\scodetrace\encoder\ScodeEncoder;

class Index {

	public function index() {
		$encoder=new \app\scodetrace\encoder\ScodeEncoder("236728136182");
		//$s=$encoder->encode("fw123456789");

		$a = ["fw123456789","fw123456790","fw123456791","fe123456791"];
		//$a = ["fw123456789"];
		//for ($b=0;$b<1000000;$b++)
			foreach ($a as $i) {
				//$s=$encoder->encode($i);
				//$encoder->decode($s);
				echo "源：".$i."<br>加密后：".($s=$encoder->encode($i))."<br>解密后：".($encoder->decode($s))."<br><br>";
			}
		echo "over<br>";
		echo $encoder->decode("R9kUu4EeOou9");
		// $model=model('admin/Rule');
		// dump($model->getAllParent([39,40,6,44]));
	}


	public function test() {
		// $m=model('scode');
		// return json($m->exportScode([1,2,3,4]));
		return \think\facade\Env::get('runtime_path');
	}

	public function test2() {
		$hashids = new ScodeEncoder();
		dump($hashids->decode('FWKX6OHZRMg6'));
	}

}

?>